<script setup lang="ts">
import { Jshare } from "@/comm/ShareConfig";
import i18n from "@/locals";
import { onMounted, ref } from "vue";
import { reload } from "@/comm/tools";
defineProps({
    iconDown: {
        type: Function,
        default: function () { },
        reqested: true
    },
});
const show = ref(false);
onMounted(() => {
    let title = i18n.global.t("message.Global.shares.ts");
    Jshare.forEach(arr => arr.forEach(item => item.setTitle(title)));
})
</script>
<template>
    <div class="j-share">
        <v-menu location="bottom" transition="slide-y-reverse-transition" v-model="show" open-on-hover>
            <template v-slot:activator="{ props }">
                <div v-bind="props">
                    <slot></slot>
                </div>
            </template>
            <div v-if="show" class="card d-flex flex-column align-center justify-center">
                <div class="row d-flex" v-for="item in Jshare">
                    <ShareNetwork class="d-inline-flex" v-for="icon in item" @open="reload" :network="icon.network" :url="icon.url"
                        :title="icon.title" :description="icon.description" :hashtags="icon.hashtags">
                        <img :src="icon.icon" />
                    </ShareNetwork>
                </div>
            </div>
        </v-menu>
    </div>
</template>

<style scoped lang="less">
@import url("./index.less");
</style>
